﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jack.EntityFrameworkCore.WebAPITest.Entities
{
    /// <summary>
    /// 商户余额
    /// </summary>
    [Table("merchant_balance")]
    public class MerchantBalanceModel : BaseModel<long>
    {
        /// <summary>
        /// 商户编号
        /// </summary>
        public long MerchantCode { get; set; }
        /// <summary>
        /// 账号类型：1-授信；2-冻结；
        /// </summary>
        public int AccountType { get; set; }
        /// <summary>
        /// 余额
        /// </summary>
        public decimal Balance { get; set; }
    }
}

/*
CREATE TABLE `merchant_balance` (
  `Id` bigint(20) NOT NULL AUTO_INCREMENT,
  `MerchantCode` bigint(20) NOT NULL COMMENT '商户编号',
  `AccountType` smallint(6) NOT NULL COMMENT '账号类型：1-授信；2-冻结；',
  `Balance` decimal(24,4) NOT NULL COMMENT '余额',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `IX_MerchantCode_AccountType` (`MerchantCode`,`AccountType`) USING HASH COMMENT '商户-账号类型-唯一'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户余额';

CREATE TABLE `merchant_balance` (
  `Id` bigint(20) NOT NULL AUTO_INCREMENT,
  `MerchantCode` bigint(20) NOT NULL COMMENT '商户编号',
  `AccountType` smallint(6) NOT NULL COMMENT '账号类型：1-授信；2-冻结；',
  `Balance` decimal(24,4) NOT NULL COMMENT '余额',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `IX_MerchantCode_AccountType` (`MerchantCode`,`AccountType`) USING HASH COMMENT '商户-账号类型-唯一'
) ENGINE=MEMORY DEFAULT CHARSET=utf8 COMMENT='商户余额';
*/
